﻿
using System;
using System.Globalization;
using System.IO;
using System.Windows.Data;

namespace YKXiangQi.Converters
{
    public class InvertBooleanConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(targetType != typeof(bool))
                throw new InvalidDataException("Must be a boolean value.");

            var result = (bool) value;
            return !result;
        }

        public object ConvertBack(object value, Type targetType, object parameter,CultureInfo culture)
        {
            throw new System.NotImplementedException();
        }
    }
}
